import entity.EntityBenz;
import entity.Car;
import entity.EntityFerrari;
import entity.EntityRoss;
import entity.EntityRoss;

public class Factory {

    public static Car newCar=null;

    public static Car SetCars(String carName){
        if(carName.equals("奔驰")){
            newCar=new EntityBenz();
            newCar.carType="salooncar";
        }else if(carName.equals("法拉利")){
            newCar=new EntityFerrari();
            newCar.carType="supercar";
        }else if(carName.equals("劳斯莱斯")){
            newCar=new EntityRoss();
            newCar.carType="Luxurycar";
    }
        return newCar;
}
}
